#ifndef __ROBOT_CONTROLLER_H__
#define __ROBOT_CONTROLLER_H__

#include <Ogre.h>
#include <OIS.h>
#include "RobotModel.h"
#include "Controller.h"
#include "PlayerModel.h"
#include "timer/TimerManager.h"
#include "PlayerController.h"
#include "World.h"

class RobotController:public AbstractController
{
protected://field
	Ogre::SceneManager* mSceneMgr;
public: //attribute
	const unsigned int NUM_MODELS;
	const Ogre::Real ANIM_CHOP;

	std::vector<RobotModel*> mRobotModels;
	//std::vector<Ogre::AnimationState*> mAnimStates;
	//std::vector<Ogre::Real> mAnimSpeeds;

	Ogre::Vector3 mWalkStartPos;
	Ogre::Vector3 mWalkEndPos;

public: //method
	virtual void AddTime(Ogre::Real deltatime);

public: //cons &destroy
	RobotController(Ogre::SceneManager *sm);
	virtual ~RobotController(){}

private:
	void Initialization();

	virtual void Send( PapaBallMsg msg );

	PlayerController *pPlayerController;

};

class updateRobotStatus: public TimeCallback
{
public:
	RobotController* pRobotController;
	updateRobotStatus(RobotController* prc){ pRobotController = prc; }
	void timeArrival(EventTimer* pCurTimer)
	{
		for(int i = 0; i < pRobotController->NUM_MODELS; i++)
		{
			pRobotController->mRobotModels[i]->ChangeStatus();
		}
	}
};

#endif
